<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>JSON Editor WYSIWYG Example</title>
    <!-- jQuery -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>

    <script src="https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/jsoneditor.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/sceditor@2.1.3/minified/sceditor.min.js" integrity="sha256-7GEpvmt+1qm9enykl3RvZdsKf57OFpg8f90CBZqT+Jc=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/sceditor@2.1.3/minified/jquery.sceditor.xhtml.min.js" integrity="sha256-nkB+zOz8M6XuTq2h6Bzt+O5cZrXERx+7eQyCMz0tP4E=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/sceditor@2.1.3/minified/jquery.sceditor.min.js" integrity="sha256-vuUmDhitRMIBuAWNi8rX02E/RWpJViZ5rRVRh/9rmHY=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/sceditor@2.1.3/minified/jquery.sceditor.bbcode.min.js" integrity="sha256-DPXQJi/qdeX7CqTZv4fEbzRdxvhVQuBwil5sfMb2krw=" crossorigin="anonymous"></script>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sceditor@2.1.3/minified/themes/default.min.css" integrity="sha256-C6XRk2o6eHt2prXw5sIA+jdMuxlKJ8sHsXtbfNsa1jg=" crossorigin="anonymous">
  </head>
  <body>
    <h1>JSON Editor WYSIWYG Example</h1>
    
    <p style='margin-bottom:20px;'>This example demonstrates JSONEditor's integration with SCEditor</p>
    
    <div id='editor_holder'></div>
    <button id='submit'>Submit (console.log)</button>
    
    <script>
      // Initialize the editor with a JSON schema
      var editor = new JSONEditor(document.getElementById('editor_holder'),{
        schema: {
          type: "object",
          title: "Blog Post",
          properties: {
            title: {
              type: "string"
            },
            body: {
              type: "string",
              format: "xhtml",
              options: {
                sceditor: {
                  
                }
              }
            }
          }
        }
      });
      
      // Hook up the submit button to log to the console
      document.getElementById('submit').addEventListener('click',function() {
        // Get the value from the editor
        console.log(editor.getValue());
      });
    </script>
  </body>
</html>
